<html>

<head>
    <meta charset="utf-8">
    <title>玩58新媒体登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--标准mui.css-->
    <link rel="stylesheet" href="../default/css/mui.min.css">
    <link rel="stylesheet" type="text/css" href="../default/css/index.css"/>
    <!--App自定义的css-->
    <style type="text/css">
        body, .mui-content {
            background-color: #fff;
        }

        .get-code-box input {
            float: left;
            padding: 10px 15px;
            width: 65%;
            font-size: 14px;
        }

        .get-code-box label {
            float: right;
            width: 35%;
            font-size: 14px;
        }

        .mui-input-group {
            background-color: transparent;
        }

        .mui-input-row .mui-btn + input, .mui-input-row label + input, .mui-input-row:last-child {
            background: #fff;
        }

        .mui-card {
            border-radius: 20px;
        }

        .mui-card {
            box-shadow: none;
        }

        .mui-input-row {
            border: 1px solid #ccc;
        }

        .phone-to-sumin-box {
            width: 100%;
            padding: 10px 15px;
        }

        .phone-to-sumin-box button {
            width: 100%;
            border-radius: 20px;
            height: 40px;
        }

        .userlogo {
            width: 100%;
            padding: 32px;
            text-align: center;
        }

        .phone-to-sumin-box a {
            color: #007aff;
        }

        .login-form-style i {
            float: left;
            width: 13%;
            height: 40px;
            line-height: 35px;
            text-align: right;
        }

        .login-form-style input, .login-form-style textarea {
            width: 87%;
        }

        .login-form-style {
            color: #ccc;
        }

        .login-form-style .mui-card {
            margin: 20px;
        }

        .login-form-style input::-webkit-input-placeholder {
            color: #ccc;
        }

        .login-form-style input::-moz-placeholder {
            color: #ccc;
        }

        .login-form-style input:-ms-input-placeholder {
            color: #ccc;
        }

        /*去除muiform的上下边框*/
        .mui-input-group:before {
            height: 0;
        }

        .mui-input-group:after {
            height: 0;
        }
    </style>

</head>

<body>
<div class="mui-content">
    <div class="userlogo">
        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/logo.jpg" width="100" alt="">
    </div>
    <form class="mui-input-group login-form-style">
        <div class="mui-input-row mui-card">
            <i class="mui-icon mui-icon-person"></i>
            <input type="text" class="mui-input-clear" name="account" id="account" placeholder="账号">
        </div>
        <div class="mui-input-row mui-card">
            <i class="mui-icon mui-icon-locked"></i>
            <input type="password" class="mui-input-clear" id="password" name="password" placeholder="密码">
        </div>
    </form>
    <div class="phone-to-sumin-box">
        <button type="button" class=" mui-btn mui-btn-warning  phone-to-sumin">登录</button>
    </div>
    <div class="login-control-box">
        <div class="login-form-shortcut">
            <hr>
            <span>操纵</span>
        </div>
        <div class="login-form-control">
            <div class="mui-row">
                <div class="mui-col-sm-6 mui-col-xs-6 mui-text-center">
                    <div class="mui-text-center">
                        <a href="../../register.html" class="opento">
                            <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/icone_index7.png" alt=""><br>
                            <p>新用户注册</p>
                        </a>
                    </div>
                </div>
                <div class="mui-col-sm-6 mui-col-xs-6">
                    <div class="mui-text-center">
                        <a href="forget-password.html" class="opento">
                            <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/icone_index5.png" alt=""><br>
                            <p>忘记密码</p>
                        </a>
                    </div>
                </div>
            </div>

        </div>

    </div>



</div>
</body>
<script src="../default/js/jquery-2.14.js" type="text/javascript" charset="utf-8"></script>
<script src="../default/js/mui.min.js"></script>
<script src="../default/js/index.js"></script><script src="../default/js/public.js"></script>
<script src="../default/js/cookie.js"></script>
<!--<script src="../default/js/vconsole.js"></script>-->
<script>
    mui.init({
        swipeBack: true //启用右滑关闭功能
    });

    // ajax地址
    /*setCookie('account', '', -1);
    setCookie('userId', '', -1);*/
    localStorage.clear();

    mui('body').on('tap', '.opento', function (e) {
        mui.openWindow({
            url: $(this).attr('href')
        });

    });

    mui("body").on('tap', '.phone-to-sumin', function () {
        var account = $("#account").val();
        var password = $("#password").val();
        if (account == null) {
            mui.toast('请输入用户名');
            return false;
        } else if (password == null) {
            mui.toast('请输入密码');
            return false;
        } else {
            $.ajax({
                url: website + "/UserController/login1",
                type: "post",
                data: {
                    "account": account,
                    "password": password,
                },
                success: function (data) {
                    mui.toast(data.msg);
                    if (data.msg == '登入成功！') {
                        localStorage.setItem("account", data.data.account);
                        localStorage.setItem("userId", data.data.userId);
                        // setCookie('account',data.data.account,10);
                        // setCookie('userId',data.data.userId,10);

                        mui.openWindow({
                            url: '../../index.html'
                        });
                    }
                }
            })
        }
        /*if (!(/^[1][3,4,5,7,8,9,9][0-9]{9}$/.test(userphone))) {
            mui.toast('请输入正确的手机号');
            return false;
        }else if (parseInt(codenumb) != 1234){
            mui.toast('验证码错误');
            return false;
        }else {
            // /UserController/login1
            mui.openWindow({
                url: '../index.html'
            });
        }*/
    });


</script>

</html>
